<template>
  <div class="tab_data">
    <div class="tab_title">
      <h3>居家</h3>
      <p>回家，放松身心</p>
    </div>
    <ul class="tab_list">
      <li v-for="v in goodslist" :key="v.id" @click="tiao(v.id)">
        <img :src="v.list_pic_url" alt="" />
        <p>{{ v.name }}</p>
        <span>{{ v.retail_price | fil}}</span>
      </li>
    </ul>
    {{ Listen }}
  </div>
</template>

<script>
import { GetGoodsList } from "@/request/api";
export default {
  name: "H559Tabdata",
  props: ["id", "brotherCategory"],
  components: {},

  directives: {},

  data() {
    return {
      goodslist: "",
    };
  },

  mounted() {},
  computed: {
    Listen() {
    
      // Toast.setDefaultOptions({ duration: 200 });
      GetGoodsList({ categoryId: this.id,size:1000 }).then((res) => {
        // console.log(res);
        this.goodslist = res.data.data;
      });
    },
  },

  methods: {
    tiao(k){
      // console.log(k);
      this.$router.push({
        path:'/goodsDetail',
        query:{
          id:k
        }
      })
    }
  },
  created() {
    //  console.log(this.brotherCategory);
    GetGoodsList({ categoryId: this.id }).then((res) => {
      // console.log(res);
      this.goodslist = res.data.data;
    });
  },
  filters: {
    fil(v) {
      v = Number(v);
      return "￥ " + v.toFixed(2) + "元";
    },
  },
};
</script>

<style lang="less" scoped>
</style>